package com.kk.combination;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 王志强
 * @date 2022-01-05
 */
public class University extends OrganizationComponent {

    List<OrganizationComponent> organizationComponents = new ArrayList<>();

    public University(String name, String des) {
        super(name, des);
    }

    @Override
    public void print() {
        System.out.println("============" + getName() + "==============");
        for (OrganizationComponent c : organizationComponents) {
            c.print();
        }
    }


    @Override
    public void add(OrganizationComponent organizationComponent) {
        organizationComponents.add(organizationComponent);
    }

    @Override
    public void remove(OrganizationComponent organizationComponent) {
        organizationComponents.remove(organizationComponent);
    }
}
